package com.yfjin.gl.filter;

import android.opengl.GLES20;
import android.opengl.GLSurfaceView;

import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;

public class MyRender implements GLSurfaceView.Renderer {


    private static final String TAG = "123123";

    private RenderView mRendView;
    private ViewFilter2 mViewFilter;


    public MyRender(RenderView rendView) {
        this.mRendView = rendView;
//        LifecycleOwner lifecycleOwner = (LifecycleOwner) rendView.getContext();
//        cameraHelper = new CameraHelper(lifecycleOwner, this);
    }

    @Override
    public void onSurfaceCreated(GL10 gl, EGLConfig config) {
        mViewFilter = new ViewFilter2(mRendView.getContext());
    }

    @Override
    public void onSurfaceChanged(GL10 gl, int width, int height) {
        GLES20.glViewport(0, 0, width, height);
    }


    //-------------------------------------------------------------------------------

    @Override
    public void onDrawFrame(GL10 gl) {
        mViewFilter.onDraw();
    }

//    public void setRenderData() {
//        mRendView.requestRender();
//    }
}
